<%@page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="html" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<html:header title="日常收入明细">

    <link rel="stylesheet" href="${baseUrl}css/public.css" media="all">

    <style type="text/css">
        a{
            color: #01AAED;
            text-decoration: none;
            font-size: 12px;
        }
        a:hover {
            color: #FF5722;
        }

        label{
             display:-moz-inline-box;
             display:inline-block;
             width:80px;
             color: #aaaaaa;
         }

        .label{
            display:-moz-inline-box;
            display:inline-block;
            width:80px;
            color: #aaaaaa;
            float: left;
        }


        .info{
            padding: 2px;
            overflow: hidden;
        }

        .bottom-info{
            color:#aaaaaa; font-size: 10px;padding-right: 10px;
        }
    </style>

    <script>
        jQuery(function () {
            $("#close").click(function () {
                closeSubIframe();
            });

        });

        layui.use(['form', 'table'], function () {
            let $ = layui.jquery,
                form = layui.form,
                table = layui.table,
                util = layui.util;

            get("${baseUrl}budget/budget/getVoById.action?id=${id}", function (res) {
                if (res.code==1) {
                    let data = res.data;

                    $("#print").click(function () {
                        document.getElementById("printFrame").contentWindow.printPage(1, data);
                    });
                    if (res.data.close) {
                        showCloseImage();
                    }

                    $("#no").html(data.no);
                    $("#store").html(data.store.name);
                    if (data.unitType == 1) {
                        $("#unit").html("无");
                    } else if (data.unitType == 2) {
                        $("#unit").html(data.custom.name);
                    } else {
                        $("#unit").html(data.provider.name);
                    }

                    $("#budgetProject").html(data.budgetProject.name);
                    $("#settAccount").html(data.settAccountVo.store.name + " > " + data.settAccountVo.name);
                    $("#amt").html(getPrice(data.amt));
                    $("#remark").html(data.remark);


                    $("#user").html(data.user.name);
                    $("#date").html(GMTToDate(data.date));

                    $("#make-time").html(data.makeTime);
                    $("#maker").html(data.makeUser.name);

                    parseImageNames(data.image);
                }
            });
        });


    </script>

</html:header>
<body>
<div class="layui-inline" style="padding-bottom: 20px;">
    <button class="layui-btn" id="print">打印</button>
    <button class="layui-btn layui-btn-primary" id="close">关闭</button>
</div>
<iframe id="printFrame" style="width:0px;height:0px" src="${baseUrl}print/budgetPrint.action" frameborder="0"></iframe>
<div class="layuimini-container">
    <div class="layuimini-main">
        <html:closeOrderImage/>

        <h2 class="tableBeforeTitle">日常收入</h2>
        <div style="height: 4px;background-color: #bbbbbb;width: 100%;margin: 20px 0 2px 0;"></div>
        <div style="height: 1px;width: 100%;background-color: #dddddd;margin-bottom: 10px;"></div>
        <div style="height: 10px;"></div>

        <div style="height: 20px;"></div>

        <hr>
        <div class="info"><label>单据编号:</label><span id="no"></span></div>
        <div class="info"><label>门店:</label><span id="store"></span></div>
        <div class="info"><label>付款单位:</label><span id="unit"></span></div>
        <div class="info"><label>账目类型:</label><span id="budgetProject"></span></div>
        <div class="info"><label>收入账户:</label><span id="settAccount"></span></div>
        <div class="info"><label>金额:</label><span id="amt"></span></div>
        <div class="info"><label>备注:</label><span id="remark"></span></div>
        <div class="info">
            <div class="label">附件图片:</div>
            <html:imageAnnex type="budget" update="true"
                             uploadUrl="${baseUrl}budget/budget/uploadImg.action"
                             updateUrl="${baseUrl}budget/budget/updateImage.action"/>
        </div>


        <hr>
        <span class="bottom-info">经办人:<span id="user"></span></span>
        <span class="bottom-info">业务日期:<span id="date"></span></span>
        <span class="bottom-info">制单人:<span id="maker"></span></span>
        <span class="bottom-info">制单时间:<span id="make-time"></span></span>
    </div>
</div>
</body>
</html>